﻿<%@ Page Title="Cursos" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="CadastroCurso.aspx.cs" Inherits="AcadPosApp.Cadastros.CadastroCurso" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style9
        {
            width: 328px;
            height: 23px;
        }
        .style10
        {
            height: 23px;
        }
        .style12
        {
            width: 328px;
        }
        .style13
        {
            width: 309px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Panel ID="pnlPesquisa" runat="server" GroupingText="Consultas de Cursos">
        <table class="style1">
            <tr>
                <td class="style13">
                    Áreas de Conhecimento
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="style13">
                    <asp:DropDownList ID="ddlAreaConhecimento" runat="server" Width="300px" AutoPostBack="True"
                        OnSelectedIndexChanged="ddlAreaConhecimento_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="style13">
                    Descrição
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="style13">
                    <asp:TextBox ID="txtPesquisa" runat="server" MaxLength="250" Width="300px" 
                        Required="required"></asp:TextBox>
                    <!-- <asp:RequiredFieldValidator ID="requiredPesquisa" runat="server" ControlToValidate="txtPesquisa"
                        ErrorMessage="É necessário preencher o campo pesquisa!" ForeColor="Red" ValidationGroup="pesquisa"
                        SetFocusOnError="True">*</asp:RequiredFieldValidator> -->
                </td>
                <td>
                    <asp:Button ID="btnConsultar" runat="server" OnClick="btnConsultar_Click"
                        Text="Consultar" ValidationGroup="pesquisa" Width="100px" />
                </td>
            </tr>
        </table>
        <br />
        <asp:GridView ID="gvwPesquisa" runat="server" AutoGenerateColumns="False" CssClass="mGrid"
            DataKeyNames="ID_CURSO" EmptyDataText="Dados não localizados..." GridLines="Vertical"
            OnRowCommand="gvwPesquisa_RowCommand" Width="45%" OnRowCreated="gvwPesquisa_RowCreated"
            OnRowDataBound="gvwPesquisa_RowDataBound" AllowPaging="True" 
            OnPageIndexChanging="gvwPesquisa_PageIndexChanging">
            <AlternatingRowStyle BackColor="#D3D3D3" />
            <Columns>
                 <%--<asp:ButtonField ButtonType="Image" CommandName="Alterar" ImageUrl="~/Imagens/edit.png"
                    Text="Button" HeaderText="Alterar" >
                    <ItemStyle  Width="20px"/>
                    </asp:ButtonField>  --%>
                <asp:TemplateField HeaderText="Editar" ShowHeader="False">
                    <ItemTemplate>
                        <abbr >
                            <asp:ImageButton ID="ImgAlterar" runat="server" CausesValidation="false" CommandName="Alterar"
                                formnovalidate="formnovalidate" ImageUrl="~/Imagens/edit.png" Text="Alterar"
                                Width="20px" />
                        </abbr>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Center" Width="1%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Excluir" ShowHeader="False">
                    <ItemTemplate>
                        <abbr title="Excluir">
                            <asp:ImageButton ID="Excluir" formnovalidate="formnovalidate" runat="server" CausesValidation="false"
                                OnClientClick="return ShowConfirm('Tem certeza que deseja excluir?', this.ID);"
                                CommandName="Excluir" ImageUrl="~/Imagens/delete.png" Text="Excluir" Width="20px"/>
                        </abbr>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Center" Width="1%" />
                </asp:TemplateField>
                <asp:BoundField DataField="ID_CURSO" HeaderText="Código">
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Center" Width="1%" />
                </asp:BoundField>
                <asp:BoundField DataField="DESCRICAO" HeaderText="Cursos">
                    <ItemStyle HorizontalAlign="Left" Width="65%" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="Status">
                    <ItemTemplate>
                        <asp:Image ID="imgStatus" runat="server" Height="25px" Width="25px" />
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Center" Width="1%" />
                </asp:TemplateField>
                <asp:BoundField DataField="SITUACAO" HeaderText="Situação">
                    <ItemStyle Width="10%" HorizontalAlign="Center" />
                </asp:BoundField>
            </Columns>
            <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
            <PagerStyle CssClass="pagination" ForeColor="Black" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#1E90FF" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#808080" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#383838" />
        </asp:GridView>
        <br />
        &nbsp;&nbsp;
        <asp:Button ID="btnInserir" runat="server" Text="Inserir" formnovalidate="formnovalidate"
            OnClick="btnInserir_Click" Width="100px" /><br /><br />
    </asp:Panel>
    <br />
    <asp:Panel ID="pnlCadastro" runat="server" GroupingText="Cadastro de Cursos por Eixo Temático"
        Visible="False">
        <table class="style1">
            <tr>
                <td class="style12">
                    Áreas de Conhecimento
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="style12">
                    <asp:DropDownList ID="ddlCadAreaConhecimento" runat="server" AutoPostBack="True"
                        Width="300px">
                    </asp:DropDownList>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="style9">
                    Descrição
                </td>
                <td class="style10">
                    Situação
                </td>
            </tr>
            <tr>
                <td class="style12">
                    <asp:TextBox ID="txtCadDescricao" runat="server" MaxLength="250" required="" 
                        Width="300px" pattern="^((.)(?!\2{3,}))+$" title="Somente são permitidos 3 caracteres iguais e consecutivos." >
                    </asp:TextBox>
                </td>
                <td>
                    <asp:DropDownList ID="ddlSituacao" runat="server" Width="150px">
                        <asp:ListItem Value="A">Ativo</asp:ListItem>
                        <asp:ListItem Value="I">Inativo</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="style12">
                    Descrição Abreviada
                </td>
                <td>
                    Data de Autorização
                </td>
            </tr>
            <tr>
                <td class="style12">
                    <asp:TextBox ID="txtCadDescricaoAbreviada" runat="server" MaxLength="50" required=""
                        Width="300px"></asp:TextBox>
                </td>
                <td>
                    <asp:TextBox ID="txtDtReconhecimento" runat="server" Height="30px" MaxLength="10"
                        required Width="150px"></asp:TextBox>
                    <asp:CalendarExtender ID="calendarioDtReconhecimento" runat="server" Enabled="True"
                        TargetControlID="txtDtReconhecimento">
                    </asp:CalendarExtender>
                </td>
            </tr>
            <tr>
                <td class="style12">
                    Reconhecimento
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="style12">
                    &nbsp;<asp:TextBox ID="txtReconhecimento" MaxLength="500" runat="server" Height="80px"
                        TextMode="MultiLine" Width="300px"></asp:TextBox>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
        </table>
        <br />
        <div class="legenda">
            &nbsp;<asp:Button ID="btnConfirmar" runat="server" OnClick="btnConfirmar_Click" 
                Text="Confirmar" ValidationGroup="cadastro" Width="100px" />
&nbsp;
            <asp:Button ID="btnCancelar" formnovalidate="formnovalidate" runat="server" Text="Cancelar"
                OnClick="btnCancelar_Click" Width="100px" />
        </div><br />
    </asp:Panel>
    <asp:ValidationSummary ID="VSPesquisa" runat="server" ShowMessageBox="True" ShowSummary="False"
        ValidationGroup="pesquisa" />
</asp:Content>
